/**
 * <p>原型接口的实现，重点注意重写clone方法，注意，拷贝有深浅之分：</p>
 * <p>1、浅拷贝 仅复制所考虑的对象，而不复制它所引用的对象，它的引用仍指向被拷贝对象中的引用</p>
 * <p>2、深拷贝 除了复制对象本身外，还要复制对象所引用的所有对象（前提是它所引用的对象也要实现cloneable接口）</p>
 * @author MIAO
 * Created on 2011-10-20
 * For more information, please visit:ismiao.com
 */
package com.ismiao.designPattern.Prototype;

public class ConcretePrototype implements Prototype {
	private String property;

	@Override
	public void setProperty(String name) {
		this.property = name;
	}

	@Override
	public String getProperty() {
		return property;
	}

	public Object clone(){
		Object object = null;
		try{
			object = super.clone();
		}catch(CloneNotSupportedException cse){
			System.out.println("the clone() method is not supported here!");
		}
		return object;
	}
}
